'''
Created on Jul 7, 2010

@author: riche
'''
from ft.framework import io_component

class FileWriterComponent(io_component.IOComponent):
    '''
    classdocs
    '''

    def __init__(self, name=None):
        '''
        Constructor
        '''
        io_component.IOComponent.__init__(self, 'filewriter')
        if name == None:
            name = 'OUTSTREAM.txt'
        self._core_file = open(name, 'w')
        
    def handle_input_stream(self, msg):
        #print(msg)
        self._core_file.write(msg)
        
    def cleanup(self):
        self._core_file.close()
        
    def get_enqueued_msgs(self):
        return []
    

    
        
        